package C.e.exception;

import C.e.try_catch.Student;

import java.io.FileNotFoundException;

public class ThrowDemo {
    public static void main(String[] args) {

       /* Student zs=new Student();
        zs.setAge(1000);
        System.out.println("此人年龄为："+zs.getAge()+"岁");

*/










       Student zs=new Student();
        try {
            zs.setAge(1000);
            System.out.println("此人年龄为："+zs.getAge()+"岁");
        }catch (RuntimeException | FileNotFoundException e){
            System.out.println("年龄不合法");
        }

        //Sz= t{z.s() S("此") }c(R e){ S}
        //Sz=nS z S
       /* Student jkl=new Student();
        try {
            jkl.setAge(200);
            System.out.println("年龄："+jkl.getAge()+"岁");
        }catch (RuntimeException e){
            System.out.println("年龄不符合");*/
        }

        /*Student ww=new Student();
        ww.setAge(200);
        System.out.println("此人年龄为："+ww.getAge()+"岁");*/

    }

